﻿using System;
using System.Linq;

namespace Basmus.Resources
{

    public class FullNameAttributeResolver : IFullNameResolver
    {
        public string Resolve(Type type)
        {
            var attribute = type
                .GetCustomAttributes(typeof (FullNameAttribute), false)
                .Cast<FullNameAttribute>()
                .FirstOrDefault();
            if (attribute == null)
                return null;
            return attribute.Name;
        }
    }
}